<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Introduction to Winapi</title>
<link rel="stylesheet" href="/cfg/format.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="keywords" content="Winapi, Windows API, Win32 API, C, no MFC">
<meta name="description" content="This is an introductory chapter to the
Windows API tutorial.">
<meta name="language" content="en">
<meta name="author" content="Jan Bodnar">
<meta name="distribution" content="global">

<script type="text/javascript" src="/lib/jquery.js"></script>
<script type="text/javascript" src="/lib/common.js"></script>

</head>

<body>

<div class="container2">

<div id="wide_ad" class="ltow">
<script type="text/javascript"><!--
google_ad_client = "pub-9706709751191532";
/* 160x600, August 2011 */
google_ad_slot = "2484182563";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

<div class="content2">


<a href="/" title="Home">Home</a>&nbsp;
<a href="..">Contents</a>


<h1>Introduction</h1>

<p>
This is Windows API tutorial. This tutorial will teach you the basics and
more advanced topics of programming in Windows API with the C programming 
language. It does not cover MFC. (Microsoft Foundation Classes is a widely used 
C++ library for developing C++ aplications on Windows.) This tutorial has been 
created and tested on Windows XP. The examples have been built using <b>Pelles C 
compiler.</b> If you plan to read this tutorial, you are advised to download and 
install this compiler. (It is a freeware.) If you want to use some other 
compiler make sure that is supports the C99 standard. 
</p>

<div class="big_hor">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9706709751191532";
/* big_horizontal */
google_ad_slot = "2904953388";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<h2>Windows API</h2>

<p>
The Windows API is the source code interface that is used to create Windows 
applications. In order to create Windows applications, we must download the 
<b>Windows SDK</b>. (Formerly known as Platform SDK.) The SDK (Software 
Development Kit) contains header files, libraries, samples, documentation and 
tools that use the Windows API to develop applications. The Windows API is 
created for C and C++ programming languages. It is the most direct way to create 
Windows applications. (If we install Pelles C, the Windows SDK is already 
included.)
</p>


<p>
The Windows API can be divided into several areas:
</p>

<ul>
<li>Base services</li>
<li>Security</li>
<li>Graphics</li>
<li>User interface</li>
<li>Multimedia</li>
<li>Windows shell</li>
<li>Networking</li>
</ul>


<p>
The <b>Base services</b> provide access to the fundamental resources on Windows. 
These include file systems, devices, processes, threads, registry or error 
handling. The <b>Security</b> area provides functions, interfaces, objects and
other programming elements for authentication, authorization, cryptography and
other security related tasks. 
The <b>Graphics</b> subsystem includes the GDI (Graphics Device Interface), 
GDI+, DirectX or OpenGL. The <b>User Interface</b> provides functionality to 
create windows and controls. The <b>Multimedia</b> component provides tools for
working with video, sound and input devices. The functions of the <b>Windows shell</b> 
interface allow applications to access the functionality provided by the 
operating system shell. The <b>Network services</b> provide access to the 
network capabilities of the Windows OS.
</p>

<p>
The Windows API is an abstract specification of the programming interface to
the Windows operating system. It consists of declarations of functions, unions,
structures, data types, macros, constants and other programming elements. 
The Windows API is described mainly by the MSDN (Microsoft Developer Network)
and resides in the Windows C headers. The official implementation of the 
Windows API functions is located in dynamic libraries (DLLs). For example 
kernel32.dll, user32.dll, gdi32.dll or shell32.dll in the Windows system 
directory. There are third-party implementations of Windows API. Most notably
the Wine and the ReactOS projects.  
</p>

<p>
Windows API is a dynamic entity. The number of functions continuously grows
with every new version of Windows OS and new service packs. There are also some
important differences between the server versions and desktop versions of the
operating system. Also some functions are not oficially documented. 
</p>


<h2>Pelles C</h2>

<p>
Pelles C is an excellent C compiler and integrated development environment (IDE)
for the C programming language. It supports both 32-bit Windows (x86) and
64-bit Windows (x64). It implements both C99 and C11 standards. Pelles C has
an integrated resource editor, bitmap, icon and cursor editor and a hex-dump
editor. It is developed by a Swedish developer Pelle Orinius. It comes with
Windows SDK, so we can immediately start creating Windows applications without
further installations.
</p>

<p>
Pelles C is a freeware. We can download Pelles C from the following link: 
<a href="http://www.smorgasbordet.com/pellesc">Pelles C download</a>.  
</p>


<h2>MSDN</h2>

<p>
The MSDN (Microsoft Developer Network) is a central portal for Windows 
development. It is a huge collection of material related to development of
Windows applications using Microsoft tools. (Third party software like Qt4 or 
Java Swing is not covered.) It is the most complete reference for the 
Windows API. The following two links are good entry points for the Windows API
reference. The 
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh447209(v=vs.85).aspx">
Windows Development reference</a> and the 
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff818516(v=vs.85).aspx">
Windows API list</a>. 
</p>

<p>
This chapter was an introduction to the Windows API. 
</p>

<div class="center"> 
<script type="text/javascript"><!--
google_ad_client = "pub-9706709751191532";
/* horizontal */
google_ad_slot = "1734478269";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script> 
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
</script> 
</div> 
<br> 


<div class="botNav, center">
<span class="botNavItem"><a href="/">Home</a></span> ‡ <span class="botNavItem"><a href="..">Contents</a></span> ‡
<span class="botNavItem"><a href="#">Top of Page</a></span>
</div>


<div class="footer">
<div class="signature">
<a href="/">ZetCode</a> last modified October 7, 2012  <span class="copyright">&copy; 2007 - 2013 Jan Bodnar</span>
</div>
</div>

</div> <!-- content -->

</div> <!-- container -->

</body> 
</html>
